package com.mujin.keji.collectionsystem.common;

/**
 * 信箱情况enum
 */
public enum EmailSituationEnum {
    water_and_electricity("water_and_electricity","有电话费、水电费单"),
    many_letters("many_letters","有大量信件"),
    lettle_letters("lettle_letters","少量信件"),
    not_water_and_electricity("not_water_and_electricity","无电话费、水电费单"),
    not_letters("not_letters","无信件"),
    sealed_mailbox("sealed_mailbox","密封信箱"),
    not_mailbox("not_mailbox","无信箱")
    ;

    /** 状态码 **/
    private String code;
    /** 状态描述 **/
    private  String description;

    EmailSituationEnum(String code, String description) {
        this.code = code;
        this.description = description;
    }

    public static String find(Integer origin) {
        if(origin == null){
            return null;
        }
        for (EmailSituationEnum frs : EmailSituationEnum.values()) {
            if ((frs.ordinal()+1) == origin) {
                return frs.getCode();
            }
        }
        return null;
    }
    public String getCode() {
        return code;
    }

    public String getDescription() {
        return description;
    }

    public static void main(String[] args) {

        System.out.println(find(1));
    }
}
